#include <iostream>
#include <thread>
#include <mutex>
std::once_flag flag;

void do_once()
{
    std::call_once(flag, [](){std::cout << "Called Once" << std::endl;});
    //std::cout << "Called Once" << std::endl;
}

int main(void)
{
    std::thread t1(do_once);
    std::thread t2(do_once);
    std::thread t3(do_once);

    t1.join();
    t2.join();
    t3.join();

    return 0;
}
